with open("writer.txt", 'w') as file_obj:
  file_obj.write("hello world")


f = "programming.txt"
with open(f, 'w') as file_obj:
    file_obj.write("Python \n")
    file_obj.write("Java \n")


with open(f, 'a') as file_obj:
    file_obj.write("C \n")
    file_obj.write("Go \n")